/*
 * config.h
 *
 *  Created on: Jan 16, 2014
 *      Author: adijoshi
 */

#ifndef CONFIG_H_
#define CONFIG_H_

#define WORDS 32*1024-1
#define R0 32736*2
#define R1 32737*2
#define R2 32738*2
#define R3 32739*2
#define R4 32740*2
#define R5 32741*2
#define SP 32742*2
#define PC 32743*2
#define PS 32744*2

typedef union{
	unsigned short word;
	unsigned char byte[2];
}MemSpaceUnion;

unsigned short MemStatus[WORDS];

MemSpaceUnion MemSpace[WORDS];

typedef enum AddressingModeEnum{
	GeneralRegAM,
	DeferredRegAM,
	AutoIncAM,
	DeferredAutoIncAM,
	AutoDecAM,
	DeferredAutoDecAM,
	IndexedAM,
	DeferredIndexedAM
} AddressingMode;

typedef enum AccessTypeEnum{
	DATA,
	INSTRUCTION
} AccessType;

typedef enum MemValidStatusEnum{
	INVALID_MEM_LOCATION,
	VALID_LOWER_BYTE,
	VALID_UPPER_BYTE,
	VALID_WORD
} MemValidStatus;

typedef enum MnemonicEnum{
	MOV,
	CMP,
	BIT,
	BIC,
	BIS,
	ADD,
	SUB,
	BR,
	BNE,
	BEQ,
	BGE,
	BLT,
	BGT,
	BLE,
	BPL,
	BMI,
	BHI,
	BLOS,
	BVC,
	BVS,
	BCC,
	BCS,
	JSR,
	RTS,
	CLR,
	COM,
	INC,
	DEC,
	NEG,
	ADC,
	SBC,
	TST,
	ROR,
	ROL,
	ASR,
	ASL,
	JMP,
	SWAB,
	HALT,
	WAIT
} Mnemonic;

#endif /* CONFIG_H_ */
